﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ShevaEngine.Core.Modules.Scenes;

namespace ShevaEngine.Core.GameLogic.Triggers
{
    /// <summary>
    /// Trigger interface.
    /// </summary>
    public abstract class Trigger : SceneObject
    {
        /// <summary>Tag.</summary>
        public object Tag;        
    }

    /// <summary>
    /// Trigger event args.
    /// </summary>
    public class TriggerEventArgs : EventArgs
    {
        /// <summary>Trigger event type.</summary>
        public TriggerEventType EventType;
        /// <summary>Trigger.</summary>
        public Trigger FirstTrigger;
        /// <summary>Trigger.</summary>
        public Trigger SecondTrigger;

        /// <summary>
        /// Constructor.
        /// </summary>
        public TriggerEventArgs(TriggerEventType eventType, Trigger firstTrigger)
            : base()
        {
            this.EventType = eventType;
            this.FirstTrigger = firstTrigger;
            this.SecondTrigger = null;
        }

        /// <summary>
        /// Constructor.
        /// </summary>
        public TriggerEventArgs(TriggerEventType eventType, Trigger firstTrigger, Trigger secondTrigger)
            : base()
        {
            this.EventType = eventType;
            this.FirstTrigger = firstTrigger;
            this.SecondTrigger = secondTrigger;
        }
    }

    /// <summary>
    /// On trigger event callback.
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    public delegate void OnTriggerEventCallback(object sender, TriggerEventArgs e);

    /// <summary>
    /// Trigger event type.
    /// </summary>
    public enum TriggerEventType
    {
        None,
        Collision,
        EndCollision,
    }
}
